/**
 * 
 */
package com.fsoft.tinhcd.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * @author caodangtinh
 * 
 */
@Entity
@Table(name = "employeedetail", schema = "hibernate")
public class EmployeeDetails {
	private int employeeId;
	private String street;
	private String city;
	private String state;
	private String country;
	private Employee employee;

	public EmployeeDetails() {
	}

	/**
	 * @param street
	 * @param city
	 * @param state
	 * @param country
	 */
	public EmployeeDetails(String street, String city, String state,
			String country) {
		super();
		this.street = street;
		this.city = city;
		this.state = state;
		this.country = country;
	}

	/**
	 * @param street
	 * @param city
	 * @param state
	 * @param country
	 * @param employee
	 */
	public EmployeeDetails(String street, String city, String state,
			String country, Employee employee) {
		super();
		this.street = street;
		this.city = city;
		this.state = state;
		this.country = country;
		this.employee = employee;
	}

	/**
	 * @return the employeeId
	 */
	@Id
	@Column(name = "EMPLOYEE_ID", nullable = false, unique = true)
	@GenericGenerator(name = "gen", strategy = "foreign", parameters = @Parameter(name = "property", value = "employee"))
	@GeneratedValue(generator = "gen")
	public int getEmployeeId() {
		return employeeId;
	}

	/**
	 * @param employeeId
	 *            the employeeId to set
	 */
	public void setEmployeeId(int employeeId) {
		this.employeeId = employeeId;
	}

	/**
	 * @return the street
	 */
	@Column(name = "STREET", nullable = false, length = 50)
	public String getStreet() {
		return street;
	}

	/**
	 * @param street
	 *            the street to set
	 */
	public void setStreet(String street) {
		this.street = street;
	}

	/**
	 * @return the city
	 */
	@Column(name = "CITY", nullable = false)
	public String getCity() {
		return city;
	}

	/**
	 * @param city
	 *            the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the state
	 */
	@Column(name = "STATE", nullable = false)
	public String getState() {
		return state;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @return the country
	 */
	@Column(name = "COUNTRY", nullable = false)
	public String getCountry() {
		return country;
	}

	/**
	 * @param country
	 *            the country to set
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * @return the employee
	 */
	@OneToOne
	@PrimaryKeyJoinColumn
	public Employee getEmployee() {
		return employee;
	}

	/**
	 * @param employee
	 *            the employee to set
	 */
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

}
